package com.yourname.myapplication.data.local.Dao

import androidx.room.Dao
import androidx.room.Insert
import androidx.room.Query
import com.yourname.myapplication.data.local.entity.QuestionEntity
import kotlinx.coroutines.flow.Flow

@Dao
interface QuestionDao {
    @Insert
    suspend fun insert(question: QuestionEntity)

    @Query("SELECT * FROM questions")
    fun getAll(): Flow<List<QuestionEntity>>

    @Query("SELECT * FROM questions WHERE id = :id")
    suspend fun getById(id: Long): QuestionEntity?
}